import { lazy } from "react";
import {
    AppOutline,
    AppstoreOutline,
    MessageOutline,
    UserContactOutline
} from 'antd-mobile-icons'


const Index = lazy(() => import('../pages/index'))
const Classify = lazy(() => import('../pages/classify'))
const Message = lazy(() => import('../pages/message'))
const User = lazy(() => import('../pages/user'))
const Home = lazy(() => import('../pages/home'))
const Detail = lazy(() => import('../pages/detail'))
const Search = lazy(() => import('../pages/search'))

export const homeRouters = [
    {
        path: '/',
        element: <Index></Index>,
        title: '首页',
        icon: <AppOutline />
    },
    {
        path: '/classify',
        element: <Classify></Classify>,
        title: '分类',
        icon: <AppstoreOutline />
    },
    {
        path: '/message',
        element: <Message></Message>,
        title: '消息',
        icon: <MessageOutline />
    },
    {
        path: '/user',
        element: <User></User>,
        title: '我的',
        icon: <UserContactOutline />
    },
]

export const routers = [
    {
        path: '/',
        element: <Home></Home>,
        children: homeRouters
    },
    {
        path: '/detail/:id',
        element: <Detail></Detail>
    },
    {
        path: '/search',
        element: <Search></Search>
    }
]